{% extends 'shop/base.html' %}

{% block title%}
    修改商品{{ goods_data.name }}
{% endblock %}

{% block label %}

{% endblock %}

{% block content %}
    <form method="post" enctype="multipart/form-data">
    {% csrf_token %}
    <table class="table">
    <tr>
        <td rowspan="4">
            <img src="/static/{{ goods_data.picture }}" style="width: 200px; height: 200px">
            <input type="file" value="/static/{{ goods_data.picture }}" name="picture" style="width: 200px;">
        </td>
        <th>商品名称</th>
        <td><input type="text" name="name" value="{{ goods_data.name }}"></td>
        <th>商品价格</th>
        <td><input type="text" name="price" value="{{ goods_data.price }}￥"></td>
    </tr>
    <tr>
        <th>商品数量</th>
        <td><input type="text" name="number" value="{{ goods_data.number }}"></td>
        <th>出厂日期</th>
        <td><input type="text" name="production" value="{{ goods_data.production }}"></td>
    </tr>
    <tr>
        <th>保质期</th>
        <td><input type="text" name="safe_date" value="{{ goods_data.safe_date }}"></td>
        <th>状态</th>
            {% if goods_data.statue %}
            <td><input type="text" name="statue" value="0"></td>
            {% else %}
            <td><input type="text" name="statue" value="1"></td>
            {% endif %}
    </tr>
    <tr>
        <th>商品描述</th>
        <td colspan="4">
{#            <textarea id="description" class="form-control form-control-user" name="description">#}
{#                {{ goods_data.description|safe}}#}
{#           </textarea>#}
            <input type="text" name="description" value="{{ goods_data.description|safe }}">
        </td>
    </tr>
    <tr>
        <td colspan="7">
{#            <a href="/Shop/goods/{{ goods_data.id }}/" class="btn btn-primary btn-block">完善商品信息</a>#}
            <input class="btn btn-primary btn-block" type="submit" value="完善商品信息">
        </td>
    </tr>
</table>
</form>
{% endblock %}